package com.example.mapper;

import com.example.Req.LotteryTicketReq;
import com.example.model.FcapNoContent;
import com.example.model.LotteryTicket;
import com.example.model.LotteryTicketRes;
import com.example.model.NumberRes;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface LotteryTicketMapper {

    int batchInsertLotteryTicket(@Param("tableName")String tableName, @Param("list") List<LotteryTicket> list);
    int batchUpdateSerialNo(@Param("tableName")String tableName, @Param("type")int type);

    Long getMaxId(@Param("tableName")String tableName);

    List<LotteryTicket> selectTicketList(@Param("sort")String sort, @Param("type")Integer type, @Param("tableName")String tableName);

    int batchUpdateLotteryTicket(@Param("list") List<LotteryTicket> list, @Param("tableName")String tableName);

    List<Long> selectNonRepeatTicketList(@Param("no")String no, @Param("number")Integer number);

    Integer getMaxSerialNo(@Param("type") Integer type, @Param("tableName")String tableName);

    List<LotteryTicketRes> selectTicketListById(List<Long> list);

    List<LotteryTicketRes> selectTickets(LotteryTicketReq req);

    Integer selectTicketsCount(LotteryTicketReq req);

    List<LotteryTicket> selectTicketListLimit(@Param("sort")String sort, @Param("num")int num);



   int insertLotteryTicket(LotteryTicketReq req);

   int updateLotteryTicket(LotteryTicketReq req);

   int delLotteryTicket(LotteryTicketReq req);

   void restartSequence(@Param("sql") String sql);

   NumberRes getSubtractSerialNo(@Param("type") Integer type, @Param("tableName")String tableName);

   List<String> getRepeatSerialNo(@Param("type") Integer type, @Param("tableName")String tableName);

   void batchInsertLotteryTicketResult(@Param("list")List<LotteryTicket> list, @Param("tableName")String tableName);

    //List<LotteryTicketRes> selectNonRepeatTicketListNew(@Param("maxSerialNo")Long maxSerialNo, @Param("num")int num, @Param("req")LotteryTicketReq req);

    //int selectNonRepeatTicketListCountNew(@Param("maxSerialNo")Long maxSerialNo, @Param("num")int num);

    //void deleteLotteryTicketResultTemp();

    //void insertLotteryTicketResultTemp(@Param("maxSerialNo")Long maxSerialNo, @Param("num")int num);

    List<LotteryTicketRes>  selectWinRepeatTicketList(@Param("maxSerialNo")Long maxSerialNo, @Param("tableName")String tableName,
                                                      @Param("num")int num, @Param("type")Integer type);

    LotteryTicketRes selectTicketByNo(@Param("serialNo") long serialNo, @Param("type")int type, @Param("tableName")String tableName);
}
